Fix race in GIC IPRIORITY and ITARGET accessors
authorSoby Mathew <[email protected]>
Fri, 15 Jan 2016 14:05:37 +0000 (14:05 +0000)
committerSoby Mathew <[email protected]>
Tue, 9 Feb 2016 16:50:36 +0000 (16:50 +0000)
commita91e12fbeac527df82b39d763a68f00d1d890cdc
tree53c39f4bc2de077ae2449011777bffc636964f30
parentdbc807179fea7438efa3374584310727ce44bbc9
Fix race in GIC IPRIORITY and ITARGET accessors

GICD_IPRIORITYR and GICD_ITARGETSR specifically support byte addressing
so that individual interrupt priorities can be atomically updated by
issuing a single byte write. The previous implementation of
gicd_set_ipriority() and gicd_set_itargetsr() used 32-bit register
accesses, modifying values for 4 interrupts at a time, using a
read-modify-write approach. This potentially may cause concurrent changes
by other CPUs to the adjacent interrupts to be corrupted. This patch fixes
the issue by modifying these accessors to use byte addressing.

Fixes ARM-software/tf-issues#343

Change-Id: Iec28b5f5074045b00dfb8d5f5339b685f9425915
drivers/arm/gic/gic_v2.c
drivers/arm/gic/v2/gicv2_helpers.c